package com.yaoweigroup.community.ui.home;

import com.yaoweigroup.community.R;
import com.yaoweigroup.community.enity.Repair;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.TextView;

/**
 * 维修记录详情
 * 
 * @author xi
 * 
 */
public class RecoderActivity extends Activity implements OnClickListener {

	private RelativeLayout left_rl;
	private TextView center_tv;
	private EditText name_et;
	private EditText address_et;
	private EditText realname_et;
	private EditText content_et;
	private EditText phone_et;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_recoder);

		left_rl = (RelativeLayout) findViewById(R.id.left_rl);
		left_rl.setOnClickListener(this);

		phone_et = (EditText) findViewById(R.id.phone_et);
		center_tv = (TextView) findViewById(R.id.center_tv);
		name_et = (EditText) findViewById(R.id.name_et);
		address_et = (EditText) findViewById(R.id.address_et);
		realname_et = (EditText) findViewById(R.id.realname_et);
		content_et = (EditText) findViewById(R.id.content_et);
		name_et.setEnabled(false);
		address_et.setEnabled(false);
		realname_et.setEnabled(false);
		content_et.setEnabled(false);
		phone_et.setEnabled(false);

		Repair repair = (Repair) getIntent().getSerializableExtra("detail");
		if (repair != null) {
			name_et.setText(repair.getName());
			realname_et.setText(repair.getAddTime());
			address_et.setText(repair.getAddress());
			phone_et.setText(repair.getPhoneNum());
			content_et.setText(repair.getContent());
		}

	}

	@Override
	public void onClick(View v) {

		switch (v.getId()) {
		case R.id.left_rl:
			finish();
			break;
		}
	}
}
